'use strict';

module.exports = app => {
  app.get('/', 'home.index');
  app.all('/oauth/redirect', 'oauth.index');
  app.get('/app/shopred/:id', 'shopred.home');
  app.get('/app/shopred/data', 'shopred.data');
  app.post('/app/shopred/addback', 'shopred.addback');
  app.post('/app/shopred/paydata', 'shopred.paydata');
  app.post('/app/shopred/result', 'shopred.result');
  app.get('/app/shopred/detail/:id', 'shopred.detail');
  app.get('/app/shopred/rule/:id', 'shopred.rule');
  app.post('/upload/wechat/image', 'upload.wechatimg');

  app.get('/app/h5/huanlian/index', 'h5.index');
  app.get('/app/h5/huanlian/select','h5.select');
  app.get('/app/h5/huanlian/detail','h5.detail');



  //小程序
    app.get('/api/app/login', 'app.auth.login');
    app.resources('banner', '/api/app/banner', 'app.banner');
    app.resources('article', '/api/app/article', 'app.article');
    app.resources('nice', '/api/app/nice', 'admin.nice');
    app.resources('formmsg', '/api/app/formmsg', 'app.formmsg');
    app.resources('tag', '/api/app/tag', 'app.tag');
    app.resources('tag', '/api/app/brand', 'admin.brand');
    app.resources('articleComment', '/api/app/articleComment', 'admin.articleComment');
    // app.resources('articles', '/api/v1/articles', 'article');


    //admin
    app.post('/api/admin/auth', 'admin.auth.login');
    app.post('/api/admin/uploadimg', 'admin.upload.image');
    app.resources('wechat', '/api/admin/wechat', 'admin.wechat');
    app.resources('banner', '/api/admin/banner', 'admin.banner');
    app.resources('nice', '/api/admin/nice', 'admin.nice');
    app.resources('menu', '/api/admin/menu', 'admin.menu');
    app.resources('article', '/api/admin/article', 'admin.article');
    app.resources('brand', '/api/admin/brand', 'admin.brand');
    app.resources('formmsg', '/api/admin/formmsg', 'admin.formmsg');
    app.resources('tag', '/api/admin/tag', 'admin.tag');
    app.resources('score', '/api/admin/score', 'admin.score');
    app.resources('class', '/api/admin/class', 'admin.class');
    app.resources('articleComment', '/api/admin/articleComment', 'admin.articleComment');
    app.post('/api/admin/articleComment/display', 'admin.articleComment.display');




    app.get('/h5/huanlian','h5.index')
    app.get('/app/lianghui/index','lianghui.index');
    app.get('/app/lianghui/list','lianghui.list');
};
